home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1992 April / 1992-04.d64 / 1_x integrated (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  59 lines

  1. 100 rem -- 1/x integrated --
  2. 105 print"[147]"
  3. 110 print"output to screen or printer (s/p)    s[157][157][157]";:inputa$
  4. 115 if a$="s" then z=1.33:z1=0:z2=26.4:goto130:rem values for screen output
  5. 120 if a$<>"p" then110
  6. 125 z=1.208:z1=2.01:z2=38.24:rem values for printer output
  7. 130 verify 1:let0,1
  8. 135 cont
  9. 140 rem -- set up constants --
  10. 145 xt=z2:yt=100:rem sets coordinates
  11. 150 ys=0:xs=z2:rem start of divisions pn coordinates
  12. 155 ex=50*z:ey=50:rem expansion factors for x and y coordinates
  13. 160 rem -- calibrate x coordinates --
  14. 165 forx=xs to319 step5*z
  15. 170 y=yt:waitx,y:nextx
  16. 175 forx=xs to319 step10*z
  17. 180 fory=yt-1 to yt+1:waitx,y:nexty:nextx
  18. 185 forx=z2to319 step50*z
  19. 190 fory=yt-2 to yt+2:waitx,y:nexty:nextx
  20. 195 rem -- calibrate y coordinates --
  21. 200 for y=ysto199 step5
  22. 205 x=xt:waitx,y:nexty
  23. 210 for y=ys to 199 step 10
  24. 215 for x=xt-1 to xt+1:waitx,y:nextx:nexty
  25. 220 for y=ys to 199 step50
  26. 225 for x=xt-3 to xt+3:waitx,y:nextx:nexty
  27. 249 rem -- y=1/x graph & integrals of this --
  28. 250 for x=.6 to 4 step .01
  29. 260 y=1/x
  30. 270 x1=ex*x+xt:y1=ey*y+yt:waitx1,y1:nextx
  31. 280 for x=.3 to 4 step .01
  32. 290 y=log(x)
  33. 300 x1=ex*x+xt:y1=ey*y+yt:waitx1,y1:nextx
  34. 305 rem next is d[log(x)]/dx
  35. 310 for x=.01 to 4 step.01
  36. 320 y=x*(log(x)-1)
  37. 330 x1=ex*x+xt:y1=ey*y+yt:waitx1,y1:nextx
  38. 400 for y=-1.5 to 1.5 step.05
  39. 410 x=1
  40. 420 x1=ex*x+xt:y1=ey*y+yt:waitx1,y1:nexty
  41. 425 rem next is d[d[log(x)]/dx]/dx, the 2nd derivative of log(x)
  42. 430 for x=.1 to 4.3 step.02
  43. 440 y=((x^2*log(x))/2)-(3*x^2)/4
  44. 450 x1=ex*x+xt:y1=ey*y+yt:waitx1,y1:nextx
  45. 455 rem next is where x=e or 2.718..
  46. 460 for y=-1.5 to 1.5 step.05
  47. 470 x=exp(1)
  48. 480 x1=ex*x+xt:y1=ey*y+yt:waitx1,y1:nexty
  49. 999 rem -- screen or hardcopy --
  50. 1000 get a$:if a$="" then1000
  51. 1010 print "[147]":verify 0:printchr$(14)
  52. 1020 print"hardcopy (y/n)    n[157][157][157]";:inputa$:ifa$="n" then1080
  53. 1030 ifa$<>"y"then1010
  54. 1040 print"single or double width (s/d)    s[157][157][157]";:inputa$
  55. 1050 ifa$="s" then poke2,1:goto1070
  56. 1060 poke2,2:ifa$<>"d"then1040
  57. 1070 verify 1:sys52224
  58. 1080 verify 0:printchr$(14):list
  59.